package com.atguigu.edu.realtime.publisher.mapping;

import com.atguigu.edu.realtime.publisher.bean.CourseReviewCnt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface CourseReviewCountMapper {
    @Select(" select\n" +
            " course_name, sum(review_count) revCnt ,sum(review_good_count) revGoodCnt, sum(review_good_count)/sum(review_count) goodRevPer\n" +
            " from\n" +
            " dws_interaction_course_review_window\n" +
            " where toYYYYMMDD(stt) = #{date}\n" +
            " group by course_name")
    List<CourseReviewCnt> selectRevUserCnt(Integer date);
}
